<ion-view view-title="我要提问" cache-view="false">
    <ion-nav-buttons side="left">
        <a class="button button-icon ion-arrow-left-c" href="#/tabs/consult/1"></a>
    </ion-nav-buttons>

    <div class="tabs-striped tabs-top">
        <div class="tabs">
            <a ng-class="{'tab-item':true,'active': false }" href="#/tabs/consult/0">全部问题</a>
            <a ng-class="{'tab-item':true,'active': false }" href="#/tabs/consult/1">我的问题</a>
            <a ng-class="{'tab-item':true,'active': true }">我要提问</a>
        </div>
    </div>

    <ion-content class="padding has-tabs-top has-footer">
        <form name="myForm" novalidate="" ng-submit="submitForm(myForm)">
            <label class="item item-input">
                <textarea name="title" ng-model="consult.title" type="text" placeholder="请描述您的问题"
                          ng-minlength="5" ng-maxlength="200" rows="5" required
                          ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0 } }">
                </textarea>
            </label>
            <!-- Error Container for Password -->
            <div class="validation-error" ng-class="{'is-dirty':form.password.$dirty}"
                 ng-messages="myForm.title.$error" role="alert">
                <div ng-messages-include="consult-add-errors.html"></div>
            </div>
            <div class="bar-footer bar">
                <button class="button button-full button-balanced" ng-disabled="myForm.$invalid" type="submit">
                    发布问题
                </button>
            </div>
        </form>
        <script id="consult-add-errors.html" type="text/ng-template">

            <div class="error" ng-message="required">
                <i class="ion-information-circled"></i> 不能为空
            </div>
            <div class="error" ng-message="minlength">
                <i class="ion-information-circled"></i> 至少输入5个字符
            </div>
            <div class="error" ng-message="maxlength">
                <i class="ion-information-circled"></i> 字符长度不能超过200个
            </div>
        </script>
    </ion-content>
</ion-view>